package xyz.zhouzhousag.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import xyz.zhouzhousag.domain.Product;

import java.util.List;

/**
 * Description:持久化
 * <p>
 * ClassName: IProductDAO
 * date: 2021/3/16 14:44
 *
 * @author Yin.Liu
 * @version 1.0
 * @since JDK 1.8
 */
@Repository
public interface IProductDAO {

    /**
     * 查询所有商品信息
     * @return
     */
    @Select("select * from product")
    List<Product> findAll();

    @Insert("insert into product(productNum,productName,cityName,departureTime,productPrice,productDesc,productStatus) values(#{productNum},#{productName},#{cityName},#{departureTime},#{productPrice},#{productDesc},#{productStatus})")
    void save(Product product);
}
